#include "apfsds_config.h"
#include <ddblk/apds/delegation/rcl.h>

static tstack_t apdstinfo_tlsstk;
static TLS_INITIAL apdstls_t *apdstinfo_tls;
DEF_APDSTINFO_TLS(&apdstinfo_tlsstk, &apdstinfo_tls, malloc, APFSDS_COREID_UPDFREQ, mp_coreid)
static TLS_INITIAL spobj_t *lknode_tls;
DEF_LOCKNODE_SPSLAB(splknode, &lknode_tls, HDEF_CACHE_LINE_BYTES, SPLK_POOL_SIZE)

DEF_COMBINE(rcl, rcl, OUFUN_OF(apdstls), OUFUN_OF(spin_wait), OUFUN_OF(spslablknode))

APDS2APFSDS(rcl, (OUFUN_OF(alignlknode))->get_lknode,  (OUFUN_OF(alignlknode))->ret_lknode)

/* 其他线程禁止绑大核 */
/* CFLOWINIT_FUNC(rclstart){
	EXCLUDE_CORE((HDEF_LITTLECORE_OFFST + HDEF_NATIVE_CPU_NR - 1) % HDEF_NATIVE_CPU_NR);
} */

/* 初始化 */
#include <pthreadalt/pthreadalt_init.h>
DEF_PTHREADALT_INIT
DEF_SYSINIT(apdstls)
DEF_CFLOWINIT(apdstls)
DEF_CFLOWFIN(apdstls, splknode)
DEF_SYSFIN(__omega)
